<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2024/11/23 0023
 * Time: 9:37
 */

namespace app\index\validate;


use think\Validate;

class Score extends Validate
{
    protected $rule = [
        'school_id' => 'require',
        'course_id' => 'require',
        'class_id' => 'require',
        'score_id' => 'require',
        'stu_id' => 'require',
        'name' => 'require',
        'total' => 'number|between:1,120',
        'score' => 'float|between:1,120',
        'time' => 'require',
    ];

    protected $message = [
        'school_id.require' => '学校必须',
        'course_id.require' => '课程必须',
        'class_id.require' => '年级必须',
        'score_id.require' => '类型必须',
        'stu_id.require' => '学生必须',
        'name.require' => '成绩名称必须',
        'total.require' => '总成绩必须',
        'score.float' => '成绩必须是数字',
        'score.between' => '成绩必须在1~120间',
        'time.require' => '考试日期必须',
    ];
}